#ifndef NODEPOINT_H
#define NODEPOINT_H
/************************************************************************/
/* note that Radius does not contain the center point!                                                                   */
/************************************************************************/

class NodePoint
{
public:
	NodePoint();
	NodePoint(int x, int y, int radius=7, Color color=Color(255, 255, 0, 0));
	NodePoint(Point2d center, int radius=7, Color color=Color(255, 255, 0, 0));

	virtual ~NodePoint(){}
	
	void setNodeNum(NODENUM number);
	NODENUM getNodeNum();

	void setNodePointCenter(Point2d center);
	void setNodePointCenter(int x, int y);
	Point2d getNodePointCenter();
	void setNodeCoarsePos(int x, int y);

	static void setNodePointRadius(int radius);

	void setNodePointColor(Color color);

	//after 2 steps:
	void setNodeRealCenterPos();
	
	//static: set node's valid draw area
	static void setDrawArea(RECT area);
	static void setDrawInterval(int maxX, int maxY);

	//use gdipus draw a point
	void DrawNodePoint(Graphics* graphics);
	Point2d CalculateOutgoingLineStartPosition(Point2d disPoint);
	bool IsInDrawArea();

	//neibour infomaiton
	NeighbourInfoArray& getNeighbourInfoArray();
private:
	void DefaultParamSetting();
	void DrawNodeNumber(Graphics* graphics);

public:
	NeighbourInfoArray mNeighbourInfoArray;

private:
	//number of node
	NODENUM mNodeNum;
	//node position color and radius
	Point2d mCenterPoint;
	static int Radius;
	Color mNodeColor;

	//font size
	int mFontSize;
	int xCoarsePos;
	int yCoarsePos;

	//valid draw area
	static RECT DrawArea;
	static int xInterval;
	static int yInterval;
	
};

#endif